#include "stdafx.h"
#include "Player.h"

#include "Scene.h"

const char* Player::Signature = "Player";

Player::Player(void) :
	State(IDLE)
	, bWithBall(false)
{
}

Player::~Player(void)
{
}

void Player::clear()
{
	bWithBall	= false;
	State		= IDLE;
}

bool Player::do_command( CTRL_CODE CtrlCode )
{
	assert( CtrlCode < CTRL_MAX );

	switch ( State )
	{
	case IDLE:
		switch (CtrlCode)
		{
		case CTRL_UP:
		case CTRL_DOWN:
		case CTRL_LEFT:
		case CTRL_RIGHT:
			State = RUN;
			break;
		case CTRL_D_UP:
		case CTRL_D_DOWN:
		case CTRL_D_LEFT:
		case CTRL_D_RIGHT:
			State = RUN_FAST;
			break;
		}
		break;
	case RUN:
		switch (State)
		{
		case CTRL_D_UP:
		case CTRL_D_DOWN:
		case CTRL_D_LEFT:
		case CTRL_D_RIGHT:
			State = RUN_FAST;
			break;
		}
		break;
	case RUN_FAST:
		break;
	case FAINT:
		break;
	case SLEEP:
		break;
	}

	return true;
}

void Player::tick()
{
	unsigned int SpeedRate = 0;
	unsigned short ExSpeedRate = 0;
	switch (State)
	{
	case WALK:
		SpeedRate = 1;
	case RUN:
		SpeedRate = 2;
	case RUN_FAST:
		ExSpeedRate = 1;
		break;
	}

	
}

bool Player::move_to( const Vector3D<int>& Dest )
{
	return false;
}